//
//  WBToolsHttp.h
//  微博项目
//
//  Created by huangchucai on 16/2/18.
//  Copyright © 2016年 com.foxconn.FuLearn. All rights reserved.
//
//
//  处理网络的请求工具类 --- 网络层


#import <Foundation/Foundation.h>

@class WBUploadParam;

@interface HttpTool : NSObject


/**
 *  发送一个GET请求
 *
 *  @param URLString  请求的URL地址字符串
 *  @param parameters 参数列表
 *  @param success    请求成功的返回
 *  @param failure    请求失败的返回
 */
+ (void)GET:(NSString *)URLString
                     parameters:(id)parameters
                        success:(void (^)(id responseObject))success
    failure:(void (^)(NSError *error))failure;

/**
 *  发送一个POST请求
 *
 *  @param URLString  请求的URL地址字符串
 *  @param parameters 参数列表
 *  @param success    请求成功的返回
 *  @param failure    请求失败的返回
 */
+ (void)POST:(NSString *)URLString
 parameters:(id)parameters
    success:(void (^)(id responseObject))success
    failure:(void (^)(NSError *error))failure;

//+ (void)Upload:(NSString *)URLString
//  parameters:(id)parameters
// uploadParam:(WBUploadParam *)uploadParam
//     success:(void (^)(id responseObject))success
//     failure:(void (^)(NSError *error))failure;

/**
 *  自己用NSURLConnection封装的一个post请求，用于返回值不是json字符串时的情况
 *
 *  @param URLString  请求的URL地址字符串
 *  @param paramString 参数列表
 *  @param success    请求成功的返回
 *  @param failure    请求失败的返回
 */
+ (void)PostNSURLConnection:(NSString *)URLString
            parameterString:(NSString *)paramString
            success:(void (^)(id  responseObject))success
            failure:(void (^)(NSError *error))failure;
/**
 *  自己用NSURLConnection封装的一个postXML请求，用于返回值(NSXMLParser *)parser时的情况
 *
 *  @param URLString  请求的URL地址字符串
 *  @param paramString 参数列表
 *  @param success    请求成功的返回
 *  @param failure    请求失败的返回
 */
+(void)postXMLNSURLConnection:(NSString *)URLString
            parameterString:(NSString *)paramString
                    success:(void (^)(id  responseObject))success
                    failure:(void (^)(NSError *error))failure;

//判断网络是否可靠
+(void)aFNetworkReachabilityStatusNotReachablesuccess:(void (^)(id responseObject))success failure:(void (^)(NSString *error))failure;


//判断网络是否可靠
+(void)checkRunTimeNetworkStatusSuccess:(void (^)(id responseObject))success failure:(void (^)(NSString *error))failure;


@end
